from itertools import pairwise
lst = [1, 2, 3, 4, 5]
print("连续重叠的数对 - ", list(pairwise(lst)))
string = "hello educative"
print("字符串中连续重叠字符对 - ", list(pairwise(string)))  # 输出：[('h', 'e'), ('e', 'l'), ..., ('e', 'v'), ('v', 'a'), ('a', 't'), ('t', 'i'), ('i', 'v'), ('v', 'e')]